Utilization of generic programming in Ray Tracing
نویسندگان
چکیده
Acknowledgements In the fi rst place I would like to thank Ing. Tomáš Davidovič for coming with the idea for this thesis and then closely supervising it. Next, I would also like to thank my family for their support during my studies, and my friends who helped me relax during tough times.Declaration I hereby declare that I have completed this thesis independently and that I have listed all the literature and publications used. I have no objection to usage of this work in compliance with the act §60 Zákona č. 121/2000Sb. (Copyright law), and with the rights connected with the copyright act including the changes in the act.Abstract Raytracing is today the most important rendering algorithm. Despite the years of research, it is still highly time-consuming and unfeasible for realtime applications. Th is thesis examines the eff ectivity of diff erent implementations of acceleration structure modularity in a C++ ray tracer. We split the acceleration structure into 3 parts: data storage, build, and intersection. Th ese parts have to be linked together in a way that allows easy change of any of them. We have implemented this by two instruments: by object-oriented programming (virtual calls) and by generic programming (templates). After that, we made several confi gurations combining both approaches, and tested their performance on six standardised scenes. Th ese tests were made for both implemented acceleration structures: uniform grid and BVH. We showed that the performance impact of virtual calls is non-negligible and, therefore, we should carefully consider using them if there exist workarounds. Abstrakt Sledování paprsku je nejdůležitější renderovací metoda současnosti. Navzdory rokům výzkumu je však stále tak výpočetně náročná, že není vhodná pro vykreslování v reálném čase. Tato práce se zabývá prozkoumáním efektivností implementací modularity akceleračních struktur ray traceru v jazyce C++. Akcelerační struktury jsme rozdělili na 3 části: skladování dat, stavbu a hledání průsečíku s paprskem. Spojení těchto částí tak, aby byla každá lehce vyměnitelná, jsme realizovali dvěma způsoby: pomocí prostředků objektově orientovaného programování (virtuální metody) a pomocí generického programování (templates). Nakonec jsme vybrali několik konfi gurací kombinujících oba přístupy, a na sérii šesti standardních testovacích scén jsme změřili výkonnostní rozdíly mezi nimi pro dvě implementované akcelerační struktury: pravidelnou mřížku a hierarchii obálek. Výsledky ukazují, že výkonnostní dopad virtuálních metod není zanedbatelný, a proto bychom každé jejich použití měli důkladně zvážit, pokud existuje způsob, jak se jim vyhnout.
منابع مشابه
Ray-tracing and Interferometry in Schwarzschild Geometry
Here, we investigate the possible optical anisotropy of vacuum due to gravitational field. In doing this, we provide sufficient evidence from direct coordinate integration of the null-geodesic equations obtained from the Lagrangian method, as well as ray-tracing equations obtained from the Plebanski’s equivalent medium theory. All calculations are done for the Schwarzschild geometry, which resu...
متن کاملSIMD Ray Stream Tracing - SIMD Ray Traversal with Generalized Ray Packets and On-the-fly Re-Ordering -
Achieving high performance on modern CPUs requires efficient utilization of SIMD units. Doing so requires that algorithms are able to take full advantage of the SIMD width offered and to not waste SIMD instructions on low utilization cases. Ray tracers exploit SIMD extensions through packet tracing. This re-casts the ray tracing algorithm into a SIMD framework, but high SIMD efficiency is only ...
متن کاملvlib: A Volume Graphics API
This paper describes vlib, a generic application programming interface for volume graphics which supports many of the significant developments in the field to date. We present an overview of the interface and describe how its novel object modeling framework is able to facilitate a variety of modeling and rendering effects, including a method of achieving spatial deformation. We also discuss a v...
متن کاملVelocity Modeling in a Vertical Transversely Isotropic Medium Using Zelt Method
In the present paper, the Zelt algorithm has been extended for ray tracing through an anisotropic model. In anisotropic media, the direction of the propagated energy generally differs from that of the plane-wave propagation. This makes velocity values to be varied in different directions. Therefore, velocity modeling in such media is completely different from that in an isotropic media. The vel...
متن کاملFacing the Challenge of Generic Hybridity in EAP Research and Pedagogy
Since its introduction to EAP theory in the 1980s, the concept of genre has proven to be a rigorous theoretical construct for a deeperunderstanding of the nature of academic discourse. However, the inherent potential of this concept as a means of classifying and categorizing academic texts has also given rise to what we have called “the misconception of homogeneity”. Criticizing this misconcept...
متن کامل